Bug 567468 – no check for trailing != NULL in
authorClaudio Saavedra <csaavedra@igalia.com>
Mon, 12 Jan 2009 09:57:01 +0000 (09:57 +0000)
committerClaudio Saavedra <csaavedra@src.gnome.org>
Mon, 12 Jan 2009 09:57:01 +0000 (09:57 +0000)
2009-01-12  Claudio Saavedra  <csaavedra@igalia.com>

Bug 567468 – no check for trailing != NULL in
gtk_text_layout_get_iter_at_position()

* gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position):
Check for trailing to be non-NULL.
* gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document
that trailing may be NULL.

svn path=/trunk/; revision=22090

ChangeLog
gtk/gtktextlayout.c
gtk/gtktextview.c

index 94e85c926b72026b5f723986f288c6eef7157654..3f282b1d8721d8e55d8c5c7adf50b0c2a5ec7b84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-12  Claudio Saavedra  <csaavedra@igalia.com>
+
+       Bug 567468 – no check for trailing != NULL in
+       gtk_text_layout_get_iter_at_position()
+
+       * gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position):
+       Check for trailing to be non-NULL.
+       * gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document
+       that trailing may be NULL.
+
 2009-01-11  Tor Lillqvist  <tml@iki.fi>
 
        Bug 523554 - Copy from GIMP to Word broken
index 8d4cddc438ebad076c3a793e2f8d550255d368c9..156503a5062d7bae29175507a702a3c498eb0b48 100644 (file)
@@ -2654,7 +2654,8 @@ void gtk_text_layout_get_iter_at_position (GtkTextLayout     *layout,
   if (y > display->height - display->top_margin - display->bottom_margin)
     {
       byte_index = _gtk_text_line_byte_count (line);
-      *trailing = 0;
+      if (trailing)
+        *trailing = 0;
     }
   else
     {
index 0c10a4d260b782881dc92d0c2738d6658c96bcf7..1ec7b0248c2144b5ce34a7f2a4fdd380f237940a 100644 (file)
@@ -1509,7 +1509,7 @@ gtk_text_view_get_iter_at_location (GtkTextView *text_view,
  * gtk_text_view_get_iter_at_position:
  * @text_view: a #GtkTextView
  * @iter: a #GtkTextIter
- * @trailing: location to store an integer indicating where
+ * @trailing: if non-%NULL, location to store an integer indicating where
  *    in the grapheme the user clicked. It will either be
  *    zero, or the number of characters in the grapheme. 
  *    0 represents the trailing edge of the grapheme.